﻿using System;

namespace XTengine.ComponentModel
{
    public class ByteConverter : TypeConverter<Byte>
    {
        public override Byte ConvertFrom(string value)
        {
            Byte result;
            if (Byte.TryParse(value, out result))
            {
                return result;
            }

            return 0;
        }

        public override string ConvertTo(Byte value)
        {
            return value.ToString();
        }
    }
}